package com.travel.document.service.impl;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.travel.document.dao.DocumentDao;
import com.travel.document.entity.Document;
import com.travel.document.service.DocumentService;

/**
 * @classDesc: 功能描述:()
 * @author:<a href="leeue@foxmail.com">李月</a>
 * @Version:v1.0
 * @createTime:2019年3月20日 上午11:55:00
 */
@Service
@Transactional
public class DocumentServiceImpl implements DocumentService {

	DocumentDao documentDao;

	// 给静态变量注入
	@Autowired
	public void setDocumentDao(DocumentDao documentDao) {
		this.documentDao = documentDao;
	}

	@Override
	public void addFile(Document document) {

		documentDao.saveAndFlush(document);

	}

	@Override
	public void deleteFile(Document document) {
		documentDao.delete(document);

	}

	@Override
	public List<String> findByObjId(Long objId) {

		return documentDao.findByObjId(objId);
	}

}
